package org.atoral.oralarithmetic.bean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;
import java.util.Map;
@Component
@ConfigurationProperties(prefix = "person") // 和配置文件person进行绑定
@Data // 自动生成get，set
@NoArgsConstructor // 无参构造
@AllArgsConstructor // 全参构造
public class Person {
    private String name;
    private Integer age;
    private Date birthday;
    private Boolean like;
    @NestedConfigurationProperty
    private Child child;// 嵌套对象
    private List<Dog> dogs; // 数组->复杂对象
    private Map<String,Cat> cats; // 表示Map
    private Dog dog;
}
